export default {
  title: [{ required: true, message: "通知标题不能为空", trigger: "blur" }],
  noticeType: [
    {
      required: true,
      message: "通知类型 0 群发 1 个人不能为空",
      trigger: "change",
    },
  ],
  users:[
    { required: true, message: "请选择通知的用户", trigger: ["blur", "change"] }
  ],
  noticeContent: [
    { required: true, message: "通知内容不能为空", trigger: "blur" },
    {
      validator: (rule, value, callback) => {
        const cleanedContent = value.replace(/<(?!img|video)[^>]*>/g, '').trim();
        if (cleanedContent === "") {
          callback(new Error("通知内容不能为空"));
        } else {
          callback();
        }
      },
      trigger: ["blur", "change"],
    },
  ],
  enabled: [{ required: true, message: "状态不能为空", trigger: "blur" }],
  createTime: [
    { required: true, message: "创建时间不能为空", trigger: "blur" },
  ],
  updateTime: [
    { required: true, message: "修改时间不能为空", trigger: "blur" },
  ],
};
